The main purpose of this file is to document the UI for HexEdit. It does not attempt to describe the source code, how to modify the program, or what to use HexEdit for. The best resource for information regarding HexEdit development is the SourceForge site:
<http://www.ifd.com/hexedit>
In order to be brief, features which are similar to the ResEdit hex editor are not described. (If you aren't familiar with ResEdit, you probably shouldn't be using HexEdit).
System Requirements
Macintosh (68K or PowerPC based)
MacOS version 7.5 or later
2MB of HD space
1MB of RAM
HexEdit can edit very large files (they don't need to fit into memory). At it's current memory setting of 600k-5000K, it can handle files of hundreds of megs in size. If you need to edit a larger file, increase HexEdit's memory partition.
Note that when HexEdit saves a file, it will (temporarily or permanetaly, depending on the "Create Backup" setting) need twice the disc space of the original file, plus a little extra for storing the changes you have made.
Memory usage and Color Schemes: Before v1.8 color windows used lots of RAM. This is no longer true, so color is now the default, and in fact all windows are color now so you can switch back and forth between B&W and color w/o having to re-open windows.
--- Opening and Saving Files
Opening a File
HexEdit supports drag and drop, automatically opening files in "Auto" mode. You may find it useful to keep an alias to HexEdit on your desktop for this purpose.
When you use the Open command, HexEdit presents a standard file dialog with three radio buttons, labeled "Data" "Resource" and "Auto".
"Data" opens the data fork.
"Resource" opens the resource fork.
"Auto" opens the data fork, if there is any data in it, otherwise it opens the resource fork.
Saving a File
When you save a file with HexEdit, it automatically backs up the last version of the file, renaming it to OriginalName~ (the original name with a tilde (~) after it). You can turn this backup feature off in the Options menu.
--- Program Menus
The File Menu
New - Creates a new, untitled file. First save will be a "save as" on untitled files
Open - Allows you to open an existing file
Close - Closes the currently open file
Edit Other Fork - Simply switches to the window containing the other fork for the file. If the window doesn't exist, HexEdit automatically opens the file's other fork in a new window and makes that window active.
Compare Files - Brings up two open dialogs, one after the other. For each, select one of the two files you wish to compare. Canceling either dialog cancels the entire compare. Once both files are selected, both file's windows will open (one on below the other) with a dialog bar beneath. This bar has compare commands; find next, find previous, edit them, and done. The finds do just that, edit them closes the dialog bar and allows you to edit both files, and done closes all three windows. Note: the find is a VERY simple find, and only compares bytes. It is not a "diff" type find. If anyone wants to add that to HexEdit it would be greatly appriciated :)
Save - Saves the frontmost edit window to it's opened file
Save As - Allows you to save the edit window to a different file
Revert - Reverts the current edit window to it's file state (ie, undoing all editing done since the file was loaded or saved)
Page Setup - Setup how you want to print documents
Print/Print Selection - Print the entire window (or just the selection, if there is one)
Quit - Quit the program
The Edit Menu
Undo - Most actions are undoable
Cut - Cut current selection (not available in ovewrite mode w/o Destructive Delete checked)
Copy - Copy current selection
Paste - Paste clipboard (replacing selection or inserting at cursor)
Clear - Clears (zeros) current selection
Select All - Selects the entire document
Note: Copies are made depending on which side of the editing window you have "current". The left (or ASCII representation of the Hex values of the data) will copy that ASCII representation of the data to the clipboard. The right column (showing the raw data as best printable to the screen) will copy the raw binary data. You can paste either format, but the binary column will paste the RAW data, even if it is an ASCII hex representation!
The Find Menu
Find/Replace - This brings up a dialog box allowing you to search for a sequence of hex bytes, or ASCII text. You can also enter a replacement string and use the Replace or Replace All buttons to replace the next occurance of the search string with the replacement string, or all subsequent occurances, withing the topmost edit window. The dialog is movable and modeless, meaning it will stay open after you do a find. The "Ignore Case" option causes finds to match strings regardless of case, while the "Wrap" option causes searches to wrap around the ends of the file.
Search Forward - This searches for the last search string, forward until the end of the file.
Search Backward - This searches for the last search string, backward until the beginning of the file.
Replace & Find Next - replaces current selection (ie, result of find?) and finds the next occurance of the last used find string (using last find's settings). Something must be selected for the replace to occur (avoids mistaken replacements)
Goto Address - This brings up a dialog which allows you to specify an address, either in hex or in decimal, and scroll the current editing window to that address. The dialog is movable and modeless, meaning it will stay open after you do a goto.
The Options Menu
Show Extended Chars - This displays ascii values in the ascii part of the dump which are higher than 80h - you will see the accents, diacriticals and symbols that are in the monaco font that HexEdit uses. This also makes it a little harder to pick out English text if you are searching for it in a large binary.
Decimal Addresses - This causes the addresses to be displayed in decimal, rather than hex.
Vertical Bars - If checked, vertical bars are drawn between four (4) byte boundries in the hex editing pane of the window. This makes it easier to reference where you are in each line. The bar is drawn in the header bar color.
Full Lines - if checked, windows are forced to a size that displays only full lines, and scrolling is set to not display partial lines at the top and/or bottom of windows.\
Overwrite - This toggles between insert mode (the default) and overwrite mode. Overwrite mode allows you to replace a sequence of bytes without affecting the offset of the subsequent bytes.
Destructive Delete - Option is only active when Ovewrite is checked. When this option is checked, and you are in Overwrite mode, the Delete key is "destructive" in that it does CAN change the size of the file, vs standard overwrite mode of non-destructively moving the cursor or zeroing bytes.
Unformatted Copies - when checked copies of Hex data are made without any formatting (ie, AAAAAA instead of AA AA AA) which is useful when pasting into certain applications. ASCII copies (made from the right side of the window) are always raw binary data.
Make Backups - If checked, when saving a file ("filename"), rename the original file to "filename~" before saving the new data using the original filename. If not checked, the original file is overwritten and can not be restored.
Compare Options - Brings up a dialog that lets you choose how file compares are performed. You can choose the data size as well as if you want to display where files are similiar or where they differ.
The Color Schemes Menu
Use Color Schemes - If selected, then all of the schemes below this item will be selectable as well, and the color of the frontmost window will be checked unless there is not a frontmost window, in which case the default color is checked. In that case, windows will be created in color and you can change the color scheme used to draw windows. The default is that only the frontmost window is effected by a scheme change. However, you can select a scheme with no open windows, or press Option while selecting a color with open windows, to change the default color scheme, which causes all open windows to update to that scheme. The default color HexEdit uses is only changed when you change the color of all windows in this way, as changing one window's color is considered a 'temp' selection.
--- Editing Key Commands
Delete - Deletes the character to right of the cursor (later in file). (not available in overwrite w/o "Destrucive Deletes" checked)
Backspace - Deletes character to left of cursor (earlier in file). In overwrite w/o "Destructive Delete" checked this will simply move the cursor as if the left arrow key was pressed.
Option + Backspace - "Clears" memory; either the selected range of bytes or the byte immediately to the LEFT of the cursor.
(NOTE: on the Mac OS keyboards now, there are two "Delete" keys: "Delete" herein refers to the smaller key, next to home and end. Backspace refers to the larger key, above the \ and ] keys. (above Return)
Clear - "Clears" memory; either the selected range of bytes or the byte immediately to the RIGHT of the cursor.
Tab / Return / Enter - These keys switch between the Hex and ASCII portions of the edit window
Left/Right/Up/Down - the arrow keys move the cursor within the editing window
Home / Option + Up Arrow - Take you to the first byte of the file
End / Option + Down Arrow - Take you to the last byte of the file
Page Up / Down - Page up and down within the file
(NOTE: if "paging only moves display" is checked, the display moves but the cursor (insert) position does NOT)
--- Modifiers on standard behaviors
Color Schemes
- Pressing "Option" when selecting a scheme makes it the "default" scheme for new windows and is saved in the program prefs
Find / Replace Dialog
- Pressing "Option" when clicking "Replace" makes it a "Replace and Find Next" button
Edit Windows
- "Shift" while clicking extends the current selection
- "Option" with Page Up / Down toggles "Movement Only" preference
- "Option" with Backspace clears cursor to left of cursor (vs deleting it)
--- Program Notes
To help you in your perusal, I have (tried to) marked all of my changes by //LR (usually followed by a descriptive comment, but not if it's "obvious", ha ha) Recently I've changed to adding the version # for my changes.
The original idea and implementation of file comparison was made by Jeff Smith.
Please, feel free to distribute this version of HexEdit as you please, I'd just ask for appropriate credit. I happen to use this program quite a bit, so if you make any changes please let me know, and I will try to get them into a new version.
Thanks to Jim for releasing such a fine program, and even more so for the source; it's helped to make this program much more useful for myself and others! You may wish to check out my web sites, my download pages have several utilities w/source.
<http://www.roathe.com/mac.html> // mac site
<http://www.roathe.com/lane.html> // my site (interlinks abound)
<http://www.ifd.com> // we're working on cool stuff!